<?php
/**
 * Created by PhpStorm.
 * User: 17828
 * Date: 2018/10/11
 * Time: 9:42
 */
namespace app\common\model;

use think\Model;

class DriverCar extends Model
{
    public function getDriveCarPrice($field,$where){
        $list['data'] = db('driver_car')->alias('dc')
            ->field($field)
            ->join('cartype c','c.cartype_id = dc.cartype_id')
            ->join('cartype ca','ca.cartype_id = c.pid')
            ->join('driving_licence dl','dc.driving_licence_id = dl.driving_licence_id')
            ->where($where)
            ->select();
        $list['count'] = db('driver_car')->alias('dc')
            ->field($field)
            ->join('cartype c','c.cartype_id = dc.cartype_id')
            ->join('cartype ca','ca.cartype_id = c.pid')
            ->join('driving_licence dl','dc.driving_licence_id = dl.driving_licence_id')
            ->where($where)
            ->count();
        return $list;
    }
}